import jdk.nashorn.internal.ir.BinaryNode;

import javax.swing.tree.TreeNode;
import java.util.ArrayList;

/**
 * Created with IntelliJ IDEA.
 * Description:
 */
public class Test {
    /*class Node {
        int val;
        Node firstChild;
        Node nextBrother;

    }*/

    //孩子表示法
    /*class TreeNode {
        int val;
        TreeNode left; //左孩子的引用
        TreeNode right; //右孩子的引用
    }*/

    //孩子双亲表示法
    class TreeNode {
        int val;
        TreeNode left; //左孩子的引用
        TreeNode right; //右孩子的引用
        TreeNode prent; //当前节点的根节点的引用
    }

    public static void main(String[] args) {
        MyBinaryTree myBinaryTree = new MyBinaryTree();
        char[] str1 = {'a'};
        char[] str2 = {'a'};
        MyBinaryTree.TreeNode node = myBinaryTree.buildTree2(str1,str2);
        System.out.println("sgjklgjd");
    }
    public static void main3(String[] args) {
        MyBinaryTree myBinaryTree = new MyBinaryTree();
        MyBinaryTree.TreeNode root = new MyBinaryTree.TreeNode('A');
        MyBinaryTree.TreeNode B = new MyBinaryTree.TreeNode('B');
        MyBinaryTree.TreeNode C = new MyBinaryTree.TreeNode('C');
        root.right = B;
        B.left = C;
        myBinaryTree.inorderTraversal(root);
    }

    public static void main2(String[] args) {
        MyBinaryTree myBinaryTree = new MyBinaryTree();
        MyBinaryTree.TreeNode root = myBinaryTree.createTree();
        MyBinaryTree.TreeNode D = new MyBinaryTree.TreeNode('D');
        MyBinaryTree.TreeNode E = new MyBinaryTree.TreeNode('E');
        System.out.println(myBinaryTree.lowestCommonAncestor(root, D, E).val);
    }

    public static void main1(String[] args) {
        MyBinaryTree myBinaryTree = new MyBinaryTree();
        MyBinaryTree.TreeNode root = myBinaryTree.createTree();
        myBinaryTree.levelOrder(root);
        System.out.println();
        System.out.println(myBinaryTree.isCompleteTree(root));
    }
}
